package cn.rdq.iknesssystem.service.impl;

import cn.rdq.api.dto.BlogShowDto;
import cn.rdq.api.po.Blog;
import cn.rdq.api.vo.BlogVo;
import cn.rdq.dao.BlogMapper;
import cn.rdq.iknesssystem.service.BlogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BlogServiceImpl extends ServiceImpl<BlogMapper, Blog> implements BlogService {

    @Autowired
    private BlogMapper blogMapper;


    @Override
    public List<BlogShowDto> listBlog(BlogVo blogVo) {
        PageHelper.startPage(blogVo.getCurrentPage(), blogVo.getPageSize());
        return blogMapper.listBlogBrief(blogVo);
    }
}
